﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class UnitUI : MonoBehaviour {

	//NGUI
	//public UITexture textureIcon;
	//public UILabel labelName;
	//unityGUI
	public Text textName;
	public XmlEntry unitData;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	//TODO Unit type (or template)
	public void SetUnit( GameUnit unit ) {
		// fill the values in the sprite
		//if (labelName!=null)
		//	labelName.text = unit.skill + ":" + unit.skillLevel;
		if (textName!=null)
			textName.text = unit.skill + ":" + unit.skillLevel;
	}
	
	public void SetUnit( XmlEntry data ) {
		unitData = data;
		//if (labelName!=null)
		//	labelName.text = data.get("key");
		if (textName!=null)
			textName.text = data.get("key");
	}
}
